<?php
namespace app\index\controller;

use think\Controller;
use think\Db;
use think\Validate;
use think\Session;
use think\Request;
use think\Paginator;


class Api extends Controller
{
    public function index()
    {
        return view('api/api');
    }


    public function checksel($sel)
    {
        // $data = input('get.');
        // dump($sel);die;
        if ($sel == "video"){
            $find = Db::name('api_user')->where('coursetype',$sel)->find();
            $src = $find['src'];


            $arr = [
                'code'    => 200, 
                'message' => 'success for request',
                'data'    => $src
                ];
            // dump($arr);die;
            return json_encode($arr);
        }
    }
}
